<?php
function alert($msg,$url,$type=null){
    if(!empty($type)){
		return "<script>layer.msg('".$msg."',{time:1000},function(){parent.location.href='".$url."'})</script>";
	}else{
		return "<script>layer.msg('".$msg."',{time:1000},function(){location.href='".$url."'})</script>";
	}
}
function showmsg($msg){
	return '<script>layer.msg("'.$msg.'")</script>';
}
function jsonencode($code,$msg,$url=null){
	$json['code'] = $code;
	$json['msg'] = $msg;
	$json['url'] = $url;
	return json_encode($json);
}
